package com.braveman.im.ui.activity;

import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;

import com.braveman.im.R;
import com.braveman.im.utils.UtilsStyle;
import com.ht.baselibs.ui.base.BaseActivity;
import com.ht.baselibs.utils.ActivityUtils;
import com.vondear.rxtools.RxBarTool;

import java.util.List;

/**
 * Created by Administrator on 2017/10/17.
 */

/**
 * 设置
 */
public class SettingActivity extends BaseActivity {
    private TextView txt_Message;
    private TextView txt_disturb;
    private TextView txt_chat;
    private TextView txt_privacy;
    private TextView txt_safety;
    private TextView txt_about;
    private Spinner spinner;
    private List<String> list;
    private ArrayAdapter<String> arrayAdapter;

    @Override
    protected void initTitleBar() {
        mTitleBarView.setTitleText("设置").setLeftBtnIcon(R.mipmap.back_black).setOnLeftBtnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityUtils.finishActivity(SettingActivity.this);
            }
        });
    }

    @Override
    protected boolean isStaticPage() {
        return true;
    }

    @Override
    protected int initContentView() {
        UtilsStyle.setStatusBarMode(this, true);
        RxBarTool.FlymeSetStatusBarLightMode(getWindow(), true);
        RxBarTool.MIUISetStatusBarLightMode(getWindow(), true);
        return R.layout.activity_setting;
    }

    @Override
    protected void initChildView() {
        // spinner = (Spinner) findViewById(R.id.sp_activity);
        txt_Message = (TextView) findViewById(R.id.txt_activity_message);
        txt_disturb = (TextView) findViewById(R.id.txt_activity_do_not_disturb);
        txt_chat = (TextView) findViewById(R.id.txt_activity_chat);
        txt_privacy = (TextView) findViewById(R.id.txt_activity_privacy);
        txt_safety = (TextView) findViewById(R.id.txt_activity_safety);
        txt_about = (TextView) findViewById(R.id.txt_activity_about);
    }

    @Override
    protected void initChildData() {
//        list = new ArrayList<String>();
//        list.add("1");
//        list.add("1");
//        list.add("1");
//        list.add("1");
//        arrayAdapter = new ArrayAdapter<String>(this, R.layout.support_simple_spinner_dropdown_item);
//        arrayAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
//        spinner.setAdapter(arrayAdapter);
    }

    @Override
    protected void setChildViewListener() {
        txt_Message.setOnClickListener(this);
        txt_disturb.setOnClickListener(this);
        txt_chat.setOnClickListener(this);
        txt_privacy.setOnClickListener(this);
        txt_safety.setOnClickListener(this);
        txt_about.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.txt_activity_message:
                ActivityUtils.startActivity(SettingActivity.this, NewMessageActivity.class);//新消息提醒
                break;
            case R.id.txt_activity_do_not_disturb:
                ActivityUtils.startActivity(SettingActivity.this, DoNotDisturbActivity.class);//勿扰模式
                break;
            case R.id.txt_activity_chat:
                ActivityUtils.startActivity(SettingActivity.this, ChatSettingActivity.class);//聊天设置
                break;
            case R.id.txt_activity_privacy:
                ActivityUtils.startActivity(SettingActivity.this, PrivacyActivity.class);//隐私设置
                break;
            case R.id.txt_activity_about:
                ActivityUtils.startActivity(SettingActivity.this, AboutActivity.class);//关于正气诚信
                break;
        }
    }
}
